//controlgeneral.c
//Control loop 
//Andrew Kovacs - St. Marks Robotics Team

void updateDriveMotors(); 

void updateDriveMotors(short rcValues[4])
{
	short motorValues[2];
	//Normal mode
	// Manipulate  input values and assign them to motor values (for driving only)
   	motorValues[LEFTMOTOR] = 512;
   	motorValues[RIGHTMOTOR] = 512;
   	int x = rcValues[RIGHT_HOR_CHAN] - 512;    // Find difference to change in x
   	int y = rcValues[RIGHT_VERT_CHAN] - 512;    // Find difference to change in y
 	
 	motorValues[LEFTMOTOR] += y;
 	motorValues[RIGHTMOTOR] += y;
 	motorValues[LEFTMOTOR] -= x;
 	motorValues[RIGHTMOTOR] += x;
  
  
   	 // Apply new motor settings and repeat loop
	 int i;
   	 for(i = 0; i < 2; i++)
   	 {
   	   setMotor(i, motorValues[i]);
   	 }
}
